﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Code.BLL.Arithmetic.Comm;
using Code.Models;

namespace Code.BLL.Arithmetic
{
    /// <summary>
    /// 上海时时乐
    /// </summary>
    internal class SHSSL : LotteryTypeProduct
    {
        public override PlayTypeProduct GetPlayType(Code.Models.PlayType_E playType)
        {
            PlayTypeProduct product;
            //直选、组选、和值、组和、前一、后一、前二、后二、合值、不定位、定位
            switch (playType)
            { 
                case Code.Models.PlayType_E.ZhiXuan:
                    product = new ZhiShuan(regexZhiShuan);
                    break;
                case Code.Models.PlayType_E.ZuSan:
                    product = new ZuSan(regZuSan );
                    break;
                case PlayType_E.ZuLiu:
                    product = new ZuLiu(regZuLiu);
                    break;
                case Code.Models.PlayType_E.ZuHe:
                    product = new ZuHe(regexZuHe);
                    break;
                case PlayType_E.ZhiHe:
                    product = new ZhiHe(regexSanXingHeZhi);
                    break;
                case Code.Models.PlayType_E.Qianer:
                    product = new Qianer(regexQianer);
                    break;
                case Code.Models.PlayType_E.Houer:
                    product = new Houer(regexHouer);
                    break;
                case Code.Models.PlayType_E.BuDingWeiDan:
                    product = new HouSanBuDingWeiDan(regexHouSanBuDingWeiDan);
                    break;
                case Code.Models.PlayType_E.DingWeiDan:
                    product = new HouSanDingWeiDan(regexHouSanDingWeiDan);
                    break;
                default:
                    throw new Exception("上海时时乐没有当前玩法:"+playType);
            }
            product.lotteryType = LotteryType.SHSSL;
            return product;
        }
        private static Regex regexZhiShuan = RegexFormats.ThreeStar;

        private static Regex regexZuShuan = regexZhiShuan;

        private static Regex regexSanXingSumValue = RegexFormats.ZhiHe;

        private static Regex regexZuHe = RegexFormats.ZuHe;

        private static Regex regexQianYi = RegexFormats.OneStar;

        private static Regex regexHouYi = regexQianYi;

        private static Regex regexQianer = RegexFormats.TwoStar;

        private static Regex regexHouer = regexQianer;

        private static Regex regexSanXingHeZhi = RegexFormats.ZhiHe;

        private static Regex regexHouSanBuDingWeiDan = regexQianYi;

        private static Regex regexHouSanDingWeiDan = RegexFormats.SanXingDingWeiDan;

        private static Regex regZuSan = RegexFormats.ZuSan;

        private static Regex regZuLiu = RegexFormats.OneStar;
    }
}
